<template>
  <div class="main22">
    <van-index-anchor :index="itzi">{{
      itzi === '热' ? '热门城市' : itzi === '#' ? '当前城市' : itzi
    }}</van-index-anchor>
    <van-cell
      :title="itms.label"
      v-for="(itms, index) in goodlist"
      :key="index"
      @click="name(itms)"
    />
  </div>
</template>

<script>
export default {
  props: ['itzi', 'list', 'renmen', 'dang'],
  computed: {
    goodlist() {
      if (this.itzi === '#') return this.dang
      if (this.itzi === '热') return this.renmen
      return this.list.filter(
        (itms) => itms.short[0].toUpperCase() === this.itzi
      )
    }
  },
  methods: {
    async name(a) {
      this.$emit('chengshi', a)
      // this.$router.push({
      //   path: '/home/sertch',
      //   query: a
      // })
    }
  }
}
</script>

<style scoped lang="less">
:deep(.van-index-anchor) {
  color: #aaa;
}
</style>
